/**
 * 
 */
package com.quiz.activity;

import com.quiz.activity.sections.SectionsBrowserActivity;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;


/**
 *
 * @author Brian Boyle
 * Apr 10, 2012
 */
public class PlaynowClickListener implements OnClickListener {

    private Context context;
    private boolean trackHistory;

    public PlaynowClickListener(Context context, boolean trackHistory) {
        this.context = context;
        this.trackHistory = trackHistory;
    }

    /**
     * {@inheritDoc}
     */
    public void onClick(View v) {
        Intent playnowIntent = new Intent(this.context, SectionsBrowserActivity.class);
        if (!trackHistory) {
            playnowIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
        }
        this.context.startActivity(playnowIntent);
    }

}
